<div class="wrapper">
    <div class="login-center mt-lg width-lg">
        <form nz-form [formGroup]="form" (ngSubmit)="submit()" role="form">
            <nz-alert *ngIf="error" [nzType]="'error'" [nzMessage]="error" [nzShowIcon]="true" class="mb-lg"></nz-alert>
            <div nz-form-item>
                <div nz-form-control [nzValidateStatus]="userName">
                    <nz-input formControlName="userName" [nzPlaceHolder]="'账号'" [nzSize]="'large'">
                        <ng-template #prefix>
                            <i class="anticon anticon-user"></i>
                        </ng-template>
                    </nz-input>
                    <ng-container *ngIf="userName.dirty || userName.touched">
                        <p nz-form-explain *ngIf="userName.errors?.required">请输入账户名！</p>
                        <p nz-form-explain *ngIf="userName.errors?.minlength">至少五个字符</p>
                    </ng-container>
                </div>
            </div>
            <div nz-form-item>
                <div nz-form-control [nzValidateStatus]="password">
                    <nz-input formControlName="password" [nzPlaceHolder]="'密码'" [nzType]="'password'" [nzSize]="'large'">
                        <ng-template #prefix>
                            <i class="anticon anticon-lock"></i>
                        </ng-template>
                    </nz-input>
                    <div nz-form-explain *ngIf="(password.dirty || password.touched) && password.errors?.required">请输入密码！</div>
                </div>
            </div>

            <div nz-form-item nz-row>
                <div nz-col [nzSpan]="12">
                    <label nz-checkbox formControlName="remember">
                        <span>自动登录</span>
                    </label>
                </div>
            </div>
            <div nz-form-item>
                <button nz-button [nzType]="'primary'" [nzLoading]="loading" [nzSize]="'large'" class="ant-btn__block">
                    <span>登录</span>
                </button>
            </div>
        </form>
    </div>
</div>